package cn.hubujyjs.mooc.controller;


import cn.hubujyjs.mooc.common.Result;
import cn.hubujyjs.mooc.entity.Subject;
import cn.hubujyjs.mooc.service.SubjectService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;

import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * <p>
 *  前端控制器
 * </p>
 *
 * @author Huang Jintao
 * @since 2022-11-15
 */
@RestController
@RequestMapping("/api/subject")
@Api(tags = "学科接口")
public class SubjectController {
    @Autowired
    private SubjectService service;

    @ApiOperation("查询学科集合")
    @GetMapping("/listSubject")
    public Result<List<Subject>> listSubject (){
        List<Subject> subjectList=service.listSubject();
        return Result.success(subjectList);
    }
}

